using System;
using System.Collections.Generic;
using System.Globalization;
using Medianamik.Core.Interfaces;
using SubSonic;

namespace Medianamik.Core.DAL.Repositories
{
    public interface IMedianamikRepository<T>
    {
        T Get(Guid nodeId, CultureInfo culture, ContentState contentState);

        IList<T> GetWithFilters(CultureInfo culture,
            ContentState contentState, ActiveStatus status,
            Guid? typeId, Guid? parentId, IEnumerable<Where> wheres,
            IEnumerable<BetweenAnd> betweensAnd, string orderByString,
            int? depth, bool withTypeInheritance);

        PagedCollection<T> PagedWithFilters(CultureInfo culture, ContentState contentState, ActiveStatus status,
           int pageIndex, int pageSize, Guid? typeId, Guid? parentId, IEnumerable<Where> wheres, IEnumerable<BetweenAnd> betweensAnd,
            string orderByString, int? depth, bool withTypeInheritance);

        IList<T> ChildsOf(Guid nodeId, bool inclusive, int maxDepth,
            CultureInfo culture, ContentState contentState, ActiveStatus status);

        IList<T> ParentsOf(Guid nodeId, bool inclusive, int maxDepth,
            CultureInfo culture, ContentState contentState, ActiveStatus status);

        IList<T> All(CultureInfo culture, ContentState contentState, ActiveStatus status);
        void Reorder(Guid id, Guid destinationId, DropPosition position);
        void SetActiveStatus(Guid id, CultureInfo culture, ActiveStatus status);
        INodeWrapper NewNode(IMedianamikDTO dto);
        INodeWrapper GetExistingNode(IMedianamikDTO dto);
        void SaveNode(INodeWrapper node);
        void PublishNode(INodeWrapper node, CultureInfo culture, DateTime startDate, DateTime? endDate);
        void SaveAndPublishNode(INodeWrapper node, CultureInfo culture, DateTime startDate, DateTime? endDate);
        void SaveNodeHandlingPositionAndParentNodeId(INodeWrapper node, Guid? parentNodeId, short? position);
        void SaveAndPublishNodeHandlingPositionAndParentNodeId(INodeWrapper node, Guid? parentNodeId, short? position, CultureInfo culture, DateTime startDate, DateTime? endDate);
    }
}